#include"ShareMemory.hpp"
#include"Fifo.hpp"
#include"Time.hpp"
#include<string.h>
int main()
{
    std::cout << "time: " << GetCurrTime() << std::endl;
    shm.CreateShm();
    shm.AttachShm();
    gpipe.OpenPipeForRead();
     struct data *image = (struct data *)shm.GetAddr();
     while(true)
     {
        gpipe.Wait();

        printf("status: %s\n", image->status);
        printf("lasttime: %s\n", image->lasttime);
        printf("image: %s\n", image->image);
        strcpy(image->status, "过期");
     }
    //sleep(10);
    //std::cout<<"client attach done"<<std::endl;
    shm.DetachShm();
    //std::cout<<"client detach done"<<std::endl;
    //sleep(10);
    shm.DleteShm();
    //std::cout<<"dlete shm"<<std::endl;

    return 0;
}